﻿using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;

using SoftwareCraft.SharePoint.Diagnostics.Demo;

namespace SoftwareCraft.SharePoint.Diagnostics.Demo.Tests
{
    public partial class Diagnostics_Demo : LayoutsPageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (IsPostBack && !string.IsNullOrEmpty(TextBox1.Text))
            //    Diagnostics.LogWarning(TextBox1.Text);
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            switch (RadioButtonList1.SelectedValue)
            {
                case "1" :
                    Diagnostics.LogError(Diagnostics.Category.Subsystem1, new Exception("SoftwareCraft Demo"), TextBox1.Text);
                    break;
                case "2" :
                    Diagnostics.LogWarning(Diagnostics.Category.Subsystem1, TextBox1.Text);
                    break;
                case "3" :
                default :
                    Diagnostics.LogVerbose(Diagnostics.Category.Subsystem1, TextBox1.Text);
                    break;
            }
        }
    }
}
